import json
CODE_TAG = 'code'
MSG_TAG = 'msg'
DATA_TAG = 'data'
SUCCESS_CODE = 0
ERROR_CODE = 500
SUCCESS_MSG = 'success'
response = {
        CODE_TAG: SUCCESS_CODE,
        MSG_TAG: SUCCESS_MSG,
        DATA_TAG: None
}
def success(msg=SUCCESS_MSG, data=None):
    response[MSG_TAG] = msg
    response[DATA_TAG] = data
    return json.dumps(response)


def error(msg):
    response[CODE_TAG] = ERROR_CODE
    response[MSG_TAG] = msg
    return json.dumps(response)


if __name__ == '__main__':
    print(success('sssssssss'))